package com.lebang.model.enums.buss;

/**
 * 性别
 *
 * @author weizx
 * @className Gender
 * @date 2018年6月27日 上午11:52:25
 */
public enum DownReword {

    /**
     * 下载试玩
     */
    //下载首次
    DOWN_FIRST("DOWN_FIRST", 1),
    //下载非首次
    DOWN_UN_FIRST("DOWN_UN_FIRST", 2),
    //浏览任务
    NONE_IN("liulangxingrenwu", 3),

    ;

    private String title;
    private int index;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    private DownReword(String title, int index) {
        this.title = title;
        this.index = index;
    }

    public static  DownReword getByIndex(int index) {
        for (DownReword e : DownReword.values()) {
            if (e.index == index) {
                return e;
            }
        }
        return null;
    }

    public DownReword getByTitle(String title) {
        if (null == title) {
            return null;
        }
        for (DownReword e : DownReword.values()) {
            if (e.title.equals(title)) {
                return e;
            }
        }
        return null;
    }
}
